package com.ygqh.baby.service.wechat.model;

import com.foxinmy.weixin4j.model.WeixinPayAccount;
import com.foxinmy.weixin4j.util.StringUtil;

public class WxPayAccount extends WeixinPayAccount {

	private static final long serialVersionUID = -2791256176906048632L;
	/**
	 * 加载支付证书文件的密码(默认为商户号)
	 */
	private String certificateKey;
	/**
	 * 商户证书文件(默认加载classpath:ca.p12)
	 */
	private String certificateFile;
	/**
	 * 微信支付分配的设备号
	 */
	private String deviceInfo;
	/**
	 * 财付通商户身份的标识
	 */
	private String partnerId;

	/**
	 * 微信分配的子商户公众账号ID
	 */
	private String subId;
	/**
	 * 微信支付分配的子商户号
	 */
	private String subMchId;

	public WxPayAccount(String appId, String appSecret, String paySignKey, String mchId) {
		super(appId, appSecret, paySignKey, mchId);
	}

	public WxPayAccount(String providerAppId, String appSecret, String paySignKey, String mchId, String subAppId, String subMchId) {
		super(providerAppId, appSecret, paySignKey, mchId);
		this.subId = subAppId;
		this.subMchId = subMchId;
	}

	public String getCertificateKey() {
		return StringUtil.isBlank(certificateKey) ? super.getMchId() : certificateKey;
	}

	public void setCertificateKey(String certificateKey) {
		this.certificateKey = certificateKey;
	}

	public String getCertificateFile() {
		return certificateFile;
	}

	public void setCertificateFile(String certificateFile) {
		this.certificateFile = certificateFile;
	}

	public String getDeviceInfo() {
		return deviceInfo;
	}

	public void setDeviceInfo(String deviceInfo) {
		this.deviceInfo = deviceInfo;
	}

	public String getPartnerId() {
		return partnerId;
	}

	public void setPartnerId(String partnerId) {
		this.partnerId = partnerId;
	}

	public String getSubId() {
		return subId;
	}

	public void setSubId(String subId) {
		this.subId = subId;
	}

	public String getSubMchId() {
		return subMchId;
	}

	public void setSubMchId(String subMchId) {
		this.subMchId = subMchId;
	}

}
